bitkeeper revision 1.990.2.7 (40d6e824hB2u1UturpvFrAcgmJLBwA)
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Mon, 21 Jun 2004 13:52:36 +0000 (13:52 +0000)
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Mon, 21 Jun 2004 13:52:36 +0000 (13:52 +0000)
Remove obsolete api. Move domain control api onto xend.

tools/xenmgr/lib/XendClient.py
tools/xenmgr/lib/XendDomain.py
tools/xenmgr/lib/server/SrvConsoleServer.py

index 76f49f49bd98abe3e6a6da45eaa0d53196c219eb..7eec62290fb0bd6f2a1c3f4dd1972eaaad6d0003 100644 (file)
@@ -244,29 +244,12 @@ class Xend:
         return xend_get(self.domainurl(id),
                         { 'op'      : 'vifs' })
     
-    def xend_domain_vif_stats(self, id, vif):
-        return xend_get(self.domainurl(id),
-                        { 'op'      : 'vif_stats',
-                          'vif'     : vif})
-
     def xend_domain_vif_ip_add(self, id, vif, ipaddr):
         return xend_call(self.domainurl(id),
                          {'op'      : 'vif_ip_add',
                           'vif'     : vif,
                           'ip'      : ipaddr })
         
-    def xend_domain_vif_scheduler_set(id, vif, bytes, usecs):
-        return xend_call(self.domainurl(id),
-                         {'op'      : 'vif_scheduler_set',
-                          'vif'     : vif,
-                          'bytes'   : bytes,
-                          'usecs'   : usecs })
-
-    def xend_domain_vif_scheduler_get(id, vif):
-        return xend_get(self.domainurl(id),
-                         {'op'      : 'vif_scheduler_get',
-                          'vif'     : vif})
-
     def xend_domain_vbds(self, id):
         return xend_get(self.domainurl(id),
                         {'op'       : 'vbds'})
@@ -276,18 +259,6 @@ class Xend:
                         {'op'       : 'vbd',
                          'vbd'      : vbd})
 
-##     def xend_domain_vbd_add(self, id, uname, dev, mode):
-##         return xend_call(self.domainurl(id),
-##                          {'op'      : 'vbd_add',
-##                           'uname'   : uname,
-##                           'dev'     : dev,
-##                           'mode'    : mode})
-
-##     def xend_domain_vbd_remove(self, id, dev):
-##         return xend_call(self.domainurl(id),
-##                          {'op'      : 'vbd_remove',
-##                           'dev'     : dev})
-
     def xend_consoles(self):
         return xend_get(self.consoleurl())
 
index 794c1f2931fdfb741b386a436d94d187e4a4734f..9ed3c6370d8a51c45afe26ef5d918887ebe762f9 100644 (file)
@@ -251,21 +251,6 @@ class XendDomain:
         self._add_domain(dominfo.id, dominfo)
         return dominfo
     
-    def domain_device_add(self, id, info):
-        """Add a device to a domain.
-        """
-        pass
-    
-    def domain_device_remove(self, id, dev):
-        """Delete a device from a domain.
-        """
-        pass
-    
-    def domain_device_configure(self, id, dev, info):
-        """Configure a domain device.
-        """
-        pass
-
     #============================================================================
     # Backward compatibility stuff from here on.
 
@@ -301,23 +286,10 @@ class XendDomain:
         if not dominfo: return None
         return dominfo.get_device_by_index(vif)
 
-    def domain_vif_stats(self, dom, vif):
-        dom = int(dom)
-        return xc.vif_stats_get(dom=dom, vif=vif)
-
     def domain_vif_ip_add(self, dom, vif, ip):
         dom = int(dom)
         return xenctl.ip.setup_vfr_rules_for_vif(dom, vif, ip)
 
-    def domain_vif_scheduler_set(self, dom, vif, bytes, usecs):
-        dom = int(dom)
-        return xc.xc_vif_scheduler_set(dom=dom, vif=vif,
-                                       credit_bytes=bytes, credit_usecs=usecs)
-
-    def domain_vif_scheduler_get(self, dom, vif):
-        dom = int(dom)
-        return xc.vif_scheduler_get(dom=dom, vif=vif)
-
     def domain_vbd_ls(self, dom):
         dominfo = self.domain_get(dom)
         if not dominfo: return []
@@ -333,19 +305,6 @@ class XendDomain:
                 return v
         return None
 
-##     def domain_vbd_add(self, dom, uname, dev, mode):
-##         dom = int(dom)
-##         vbd = vm.make_disk(dom, uname, dev, mode)
-##         return vbd
-
-##     def domain_vbd_remove(self, dom, dev):
-##         dom = int(dom)
-##         vbd = xenctl.vdisk.blkdev_name_to_number(dev)
-##         if vbd < 0: return vbd
-##         err = xc.vbd_destroy(dom, vbd)
-##         if err < 0: return err
-##         return vbd
-
     def domain_shadow_control(self, dom, op):
         dom = int(dom)
         return xc.shadow_control(dom, op)
index 88f3964811db65ed81fe37afb105026418314770..c33ddbd8326e6acf74f70366909939734f1afeef 100644 (file)
@@ -21,6 +21,8 @@ from twisted.internet import protocol
 from twisted.internet import abstract
 from twisted.internet import defer
 
+import Xc; xc = Xc.new()
+
 import xend.utils
 
 from xenmgr import sxp
@@ -559,6 +561,16 @@ class Daemon:
         reactor.diconnectAll()
         sys.exit(0)
 
+    def blkif_set_control_domain(self, dom):
+        """Set the block device backend control domain.
+        """
+        return self.blkifCF.setControlDomain(dom)
+    
+    def blkif_get_control_domain(self, dom):
+        """Get the block device backend control domain.
+        """
+        return self.blkifCF.getControlDomain()
+    
     def blkif_create(self, dom):
         """Create a block device interface controller.
         
@@ -579,6 +591,16 @@ class Daemon:
         d = ctrl.attach_device(vdev, mode, segment)
         return d
 
+    def netif_set_control_domain(self, dom):
+        """Set the network interface backend control domain.
+        """
+        return self.netifCF.setControlDomain(dom)
+
+    def netif_get_control_domain(self, dom):
+        """Get the network interface backend control domain.
+        """
+        return self.netifCF.getControlDomain()
+    
     def netif_create(self, dom):
         """Create a network interface controller.
         
@@ -622,6 +644,28 @@ class Daemon:
         if console.conn:
             console.conn.loseConnection()
 
+    def domain_start(self, id):
+        """Start domain running.
+        """
+        dom = int(id)
+        if dom <= 0: return 0
+        return xc.domain_start(dom=dom)
+        
+    def domain_stop(self, id):
+        """Stop domain running.
+        """
+        dom = int(id)
+        if dom <= 0: return 0 
+        xc.domain_stop(dom=dom)
+
+    def domain_destroy(self, id, force=0):
+        """Destroy a domain. Shutdown if force=0, terminate immediately if force=1.
+        """
+        dom = int(id)
+        if dom <= 0: return 0 
+        return xc.domain_destroy(dom=dom, force=0)
+    
+
 def instance():
     global inst
     try: